import * as echarts from 'echarts';
type EChartsOption = echarts.EChartsOption;

export default function pieOption2(myChart:echarts.ECharts){
    return {
        title: {
            text: 'Pie Chart2',
            subtext: 'Fake Data',
            left: 'center'
        },
        tooltip: {
            trigger: 'item'
        },
        // legend: {
        //   top: '5%',
        //   left: 'center'
        // },
        series: [
            {
                name: 'Pie Chart2',
                type: 'pie',
                radius: ['40%', '70%'],
                avoidLabelOverlap: false,
                // 设置样式
                // itemStyle: {
                //     borderRadius: 10,
                //     borderColor: '#fff',
                //     borderWidth: 2
                // },
                label: {
                    show: false,
                    position: 'center'
                },
                top:"20",
                emphasis: {
                    label: {
                        show: true,
                        fontSize: 18,
                        fontWeight: 'bold'
                    }
                },
                labelLine: {
                    show: false
                },
                data: [
                    { value: 1048, name: '睡觉' },
              { value: 735, name: '吃饭' },
              { value: 580, name: '玩手机' },
              { value: 484, name: '看电视' },
              { value: 300, name: '吃零食' }
                ]
            }
        ]
    } as EChartsOption;
}

